package com.nxj;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;

public class Springboot {

    public static void run(Class clazz, String[] args) throws LifecycleException, ServletException {
        System.out.println("boot begin");

        // 这边初始化tomcat 并且启动 等待
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(8070);
        tomcat.addWebapp("/", "D:\\");

        tomcat.start();
        tomcat.getServer().await();
        System.out.println("boot end");
    }

}
